package com.bfs.anasit.model;

import com.bfs.core.model.BaseModel;

import javax.enterprise.context.Dependent;
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.Model;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.inject.Named;
import javax.inject.Inject;
import javax.persistence.*;
import java.sql.Date;

/**
 * User: lukman
 * Date: 6/24/11
 * Time: 11:35 AM
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Named
@Dependent
public class Record extends BaseModel {

    private Long id;
    private Date date;
    @Inject
    private Patient patient;
    private String ward;
    private Long systole;
    private Long diastole;

    @Inject
    @Embedded
    private PreOperationRecord preOperationRecord;


    @Inject
    @Embedded
    private IntraOperationRecord intraOperationRecord;

    private RecoveryRecord recoveryRecord;

    public Record() {
    }

    @Id
    @GeneratedValue
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    @ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REFRESH})
    @JoinColumn
    public Patient getPatient() {
        return patient;
    }

    public void setPatient(Patient patient) {
        this.patient = patient;
    }

    public String getWard() {
        return ward;
    }

    public void setWard(String ward) {
        this.ward = ward;
    }

    public PreOperationRecord getPreOperationRecord() {
        return preOperationRecord;
    }

    public void setPreOperationRecord(PreOperationRecord preOperationRecord) {
        this.preOperationRecord = preOperationRecord;
    }

    public IntraOperationRecord getIntraOperationRecord() {
        return intraOperationRecord;
    }

    public void setIntraOperationRecord(IntraOperationRecord intraOperationRecord) {
        this.intraOperationRecord = intraOperationRecord;
    }

    public RecoveryRecord getRecoveryRecord() {
        return recoveryRecord;
    }

    public void setRecoveryRecord(RecoveryRecord recoveryRecord) {
        this.recoveryRecord = recoveryRecord;
    }

    public Long getSystole() {
        return systole;
    }

    public void setSystole(Long systole) {
        this.systole = systole;
    }

    public Long getDiastole() {
        return diastole;
    }

    public void setDiastole(Long diastole) {
        this.diastole = diastole;
    }
}
